
{
  "id": "{{#service.group}}{{service.group}}/{{/service.group}}{{service.name}}",
  "cpus": {{service.cpus}},
  "mem": {{service.mem}},
  "instances": {{service.instances}},
  "user": "{{#service.user}}{{service.user}}{{/service.user}}",
  "constraints": [["hostname", "UNIQUE"]],
  "ports": [
    {{#marathon.http-port}}{{marathon.http-port}}{{/marathon.http-port}}{{^marathon.http-port}}0{{/marathon.http-port}}
    , 0
    {{#marathon.ssl-keystore-path}}
    {{#marathon.ssl-keystore-password}}
    , {{#marathon.https-port}}{{marathon.https-port}}{{/marathon.https-port}}{{^marathon.https-port}}0{{/marathon.https-port}}
    {{/marathon.ssl-keystore-password}}
    {{/marathon.ssl-keystore-path}}
  ],
  "uris": {{service.uris}},
  "healthChecks": [
    {
      "gracePeriodSeconds": 1800,
      "intervalSeconds": 10,
      "maxConsecutiveFailures": 3,
      "path": "/ping",
      "portIndex": 0,
      "protocol": "HTTP",
      "timeoutSeconds": 5
    }
  ],
  "container": {
    "type": "DOCKER",
    "docker": {
      "image": "{{resource.assets.container.docker.image}}",
      "network": "HOST"
    }
  },
  "env": {
    "MESOS_NATIVE_JAVA_LIBRARY": "/usr/lib/libmesos.so",
    "JVM_OPTS": "-Xms{{jvm.heap-min}}m -Xmx{{jvm.heap-max}}m {{#jvm.opts}}{{jvm.opts}}{{/jvm.opts}}"
  },
  "cmd": "LIBPROCESS_PORT=$PORT1 && ./bin/start {{#marathon.access-control-allow-origin}}--access_control_allow_origin \"{{marathon.access-control-allow-origin}}\"{{/marathon.access-control-allow-origin}} {{#marathon.backup-location}}--backup_location \"{{marathon.backup-location}}\"{{/marathon.backup-location}} {{#marathon.checkpoint}} --checkpoint{{/marathon.checkpoint}}{{^marathon.checkpoint}}--disable_checkpoint{{/marathon.checkpoint}} {{#marathon.decline-offer-duration}}--decline_offer_duration \"{{marathon.decline-offer-duration}}\"{{/marathon.decline-offer-duration}} {{#marathon.default-accepted-resource-roles}}--default_accepted_resource_roles \"{{marathon.default-accepted-resource-roles}}\"{{/marathon.default-accepted-resource-roles}} {{#marathon.default-network-name}}--default_network_name \"{{marathon.default-network-name}}\"{{/marathon.default-network-name}} {{#marathon.deprecated-features}}--deprecated_features \"{{marathon.deprecated-features}}\"{{/marathon.deprecated-features}} {{#marathon.disable-http}}--disable_http{{/marathon.disable-http}} {{#marathon.draining-seconds}}--draining_seconds \"{{marathon.draining-seconds}}\"{{/marathon.draining-seconds}} {{#marathon.enable-features}}--enable_features \"{{marathon.enable-features}}\"{{/marathon.enable-features}} {{#marathon.env-vars-prefix}}--env_vars_prefix \"{{marathon.env-vars-prefix}}\"{{/marathon.env-vars-prefix}} {{#marathon.event-stream-max-outstanding-messages}}--event_stream_max_outstanding_messages \"{{marathon.event-stream-max-outstanding-messages}}\"{{/marathon.event-stream-max-outstanding-messages}} {{#marathon.executor}}--executor \"{{marathon.executor}}\"{{/marathon.executor}} {{#marathon.failover-timeout}}--failover_timeout \"{{marathon.failover-timeout}}\"{{/marathon.failover-timeout}} --framework_name {{#marathon.framework-name}}{{marathon.framework-name}}{{/marathon.framework-name}}{{^marathon.framework-name}}{{service.name}}{{/marathon.framework-name}} {{#marathon.gpu-scheduling-behavior}}--gpu_scheduling_behavior \"{{marathon.gpu-scheduling-behavior}}\"{{/marathon.gpu-scheduling-behavior}} {{#marathon.group-versions-cache-size}}--group_versions_cache_size \"{{marathon.group-versions-cache-size}}\"{{/marathon.group-versions-cache-size}} {{#marathon.ha}} --ha{{/marathon.ha}}{{^marathon.ha}}--disable_ha{{/marathon.ha}} --hostname {{#marathon.hostname}}{{marathon.hostname}}{{/marathon.hostname}}{{^marathon.hostname}}$LIBPROCESS_IP{{/marathon.hostname}} {{#marathon.http-address}}--http_address \"{{marathon.http-address}}\"{{/marathon.http-address}} {{#marathon.http-compression}} --http_compression{{/marathon.http-compression}}{{^marathon.http-compression}}--disable_http_compression{{/marathon.http-compression}} {{#marathon.http-credentials}}--http_credentials \"{{marathon.http-credentials}}\"{{/marathon.http-credentials}} {{#marathon.http-max-concurrent-requests}}--http_max_concurrent_requests \"{{marathon.http-max-concurrent-requests}}\"{{/marathon.http-max-concurrent-requests}} --http_port {{#marathon.http-port}}{{marathon.http-port}}{{/marathon.http-port}}{{^marathon.http-port}} $PORT0 {{/marathon.http-port}} {{#marathon.http-realm}}--http_realm \"{{marathon.http-realm}}\"{{/marathon.http-realm}} {{#marathon.https-address}}--https_address \"{{marathon.https-address}}\"{{/marathon.https-address}} {{#marathon.ssl-keystore-path}}--https_port {{#marathon.https-port}}{{marathon.https-port}}{{/marathon.https-port}}{{^marathon.https-port}} $PORT2 {{/marathon.https-port}}{{/marathon.ssl-keystore-path}} {{#marathon.launch-token-refresh-interval}}--launch_token_refresh_interval \"{{marathon.launch-token-refresh-interval}}\"{{/marathon.launch-token-refresh-interval}} {{#marathon.launch-tokens}}--launch_tokens \"{{marathon.launch-tokens}}\"{{/marathon.launch-tokens}} {{#marathon.leader-proxy-connection-timeout}}--leader_proxy_connection_timeout \"{{marathon.leader-proxy-connection-timeout}}\"{{/marathon.leader-proxy-connection-timeout}} {{#marathon.leader-proxy-max-open-connections}}--leader_proxy_max_open_connections \"{{marathon.leader-proxy-max-open-connections}}\"{{/marathon.leader-proxy-max-open-connections}} {{#marathon.leader-proxy-read-timeout}}--leader_proxy_read_timeout \"{{marathon.leader-proxy-read-timeout}}\"{{/marathon.leader-proxy-read-timeout}} {{#marathon.leader-proxy-ssl-ignore-hostname}}--leader_proxy_ssl_ignore_hostname \"{{marathon.leader-proxy-ssl-ignore-hostname}}\"{{/marathon.leader-proxy-ssl-ignore-hostname}} {{#marathon.local-port-max}}--local_port_max \"{{marathon.local-port-max}}\"{{/marathon.local-port-max}} {{#marathon.local-port-min}}--local_port_min \"{{marathon.local-port-min}}\"{{/marathon.local-port-min}} {{#marathon.logging-level}}--logging_level \"{{marathon.logging-level}}\"{{/marathon.logging-level}} {{#marathon.logstash}}--logstash \"{{marathon.logstash}}\"{{/marathon.logstash}} {{#marathon.maintenance-mode}} --maintenance_mode{{/marathon.maintenance-mode}}{{^marathon.maintenance-mode}}--disable_maintenance_mode{{/marathon.maintenance-mode}} {{#marathon.master}}--master \"{{marathon.master}}\"{{/marathon.master}} {{#marathon.max-apps}}--max_apps \"{{marathon.max-apps}}\"{{/marathon.max-apps}} {{#marathon.max-instances-per-offer}}--max_instances_per_offer \"{{marathon.max-instances-per-offer}}\"{{/marathon.max-instances-per-offer}} {{#marathon.max-running-deployments}}--max_running_deployments \"{{marathon.max-running-deployments}}\"{{/marathon.max-running-deployments}} {{#marathon.mesos-authentication}} --mesos_authentication{{/marathon.mesos-authentication}}{{^marathon.mesos-authentication}}--disable_mesos_authentication{{/marathon.mesos-authentication}} --mesos_authentication_principal {{#marathon.mesos-authentication-principal}}{{marathon.mesos-authentication-principal}}{{/marathon.mesos-authentication-principal}}{{^marathon.mesos-authentication-principal}}{{service.name}}{{/marathon.mesos-authentication-principal}} {{#marathon.mesos-authentication-secret}}--mesos_authentication_secret \"{{marathon.mesos-authentication-secret}}\"{{/marathon.mesos-authentication-secret}} {{#marathon.mesos-authentication-secret-file}}--mesos_authentication_secret_file \"{{marathon.mesos-authentication-secret-file}}\"{{/marathon.mesos-authentication-secret-file}} {{#marathon.mesos-bridge-name}}--mesos_bridge_name \"{{marathon.mesos-bridge-name}}\"{{/marathon.mesos-bridge-name}} {{#marathon.mesos-leader-ui-url}}--mesos_leader_ui_url \"{{marathon.mesos-leader-ui-url}}\"{{/marathon.mesos-leader-ui-url}} --mesos_role {{#marathon.mesos-role}}{{marathon.mesos-role}}{{/marathon.mesos-role}}{{^marathon.mesos-role}}{{service.name}}{{/marathon.mesos-role}} {{#marathon.mesos-user}}--mesos_user \"{{marathon.mesos-user}}\"{{/marathon.mesos-user}} {{#marathon.metrics}} --metrics{{/marathon.metrics}}{{^marathon.metrics}}--disable_metrics{{/marathon.metrics}} {{#marathon.metrics-datadog}} --metrics_datadog{{/marathon.metrics-datadog}}{{^marathon.metrics-datadog}}--disable_metrics_datadog{{/marathon.metrics-datadog}} {{#marathon.metrics-datadog-api-key}}--metrics_datadog_api_key \"{{marathon.metrics-datadog-api-key}}\"{{/marathon.metrics-datadog-api-key}} {{#marathon.metrics-datadog-host}}--metrics_datadog_host \"{{marathon.metrics-datadog-host}}\"{{/marathon.metrics-datadog-host}} {{#marathon.metrics-datadog-port}}--metrics_datadog_port \"{{marathon.metrics-datadog-port}}\"{{/marathon.metrics-datadog-port}} {{#marathon.metrics-datadog-protocol}}--metrics_datadog_protocol \"{{marathon.metrics-datadog-protocol}}\"{{/marathon.metrics-datadog-protocol}} {{#marathon.metrics-datadog-transmission-interval-ms}}--metrics_datadog_transmission_interval_ms \"{{marathon.metrics-datadog-transmission-interval-ms}}\"{{/marathon.metrics-datadog-transmission-interval-ms}} {{#marathon.metrics-histogram-reservoir-highest-trackable-value}}--metrics_histogram_reservoir_highest_trackable_value \"{{marathon.metrics-histogram-reservoir-highest-trackable-value}}\"{{/marathon.metrics-histogram-reservoir-highest-trackable-value}} {{#marathon.metrics-histogram-reservoir-reset-periodically}} --metrics_histogram_reservoir_reset_periodically{{/marathon.metrics-histogram-reservoir-reset-periodically}}{{^marathon.metrics-histogram-reservoir-reset-periodically}}--disable_metrics_histogram_reservoir_reset_periodically{{/marathon.metrics-histogram-reservoir-reset-periodically}} {{#marathon.metrics-histogram-reservoir-resetting-chunks}}--metrics_histogram_reservoir_resetting_chunks \"{{marathon.metrics-histogram-reservoir-resetting-chunks}}\"{{/marathon.metrics-histogram-reservoir-resetting-chunks}} {{#marathon.metrics-histogram-reservoir-resetting-interval-ms}}--metrics_histogram_reservoir_resetting_interval_ms \"{{marathon.metrics-histogram-reservoir-resetting-interval-ms}}\"{{/marathon.metrics-histogram-reservoir-resetting-interval-ms}} {{#marathon.metrics-histogram-reservoir-significant-digits}}--metrics_histogram_reservoir_significant_digits \"{{marathon.metrics-histogram-reservoir-significant-digits}}\"{{/marathon.metrics-histogram-reservoir-significant-digits}} {{#marathon.metrics-name-prefix}}--metrics_name_prefix \"{{marathon.metrics-name-prefix}}\"{{/marathon.metrics-name-prefix}} {{#marathon.metrics-prometheus}} --metrics_prometheus{{/marathon.metrics-prometheus}}{{^marathon.metrics-prometheus}}--disable_metrics_prometheus{{/marathon.metrics-prometheus}} {{#marathon.metrics-statsd}} --metrics_statsd{{/marathon.metrics-statsd}}{{^marathon.metrics-statsd}}--disable_metrics_statsd{{/marathon.metrics-statsd}} {{#marathon.metrics-statsd-host}}--metrics_statsd_host \"{{marathon.metrics-statsd-host}}\"{{/marathon.metrics-statsd-host}} {{#marathon.metrics-statsd-port}}--metrics_statsd_port \"{{marathon.metrics-statsd-port}}\"{{/marathon.metrics-statsd-port}} {{#marathon.metrics-statsd-transmission-interval-ms}}--metrics_statsd_transmission_interval_ms \"{{marathon.metrics-statsd-transmission-interval-ms}}\"{{/marathon.metrics-statsd-transmission-interval-ms}} {{#marathon.min-revive-offers-interval}}--min_revive_offers_interval \"{{marathon.min-revive-offers-interval}}\"{{/marathon.min-revive-offers-interval}} {{#marathon.offer-matching-timeout}}--offer_matching_timeout \"{{marathon.offer-matching-timeout}}\"{{/marathon.offer-matching-timeout}} {{#marathon.on-elected-prepare-timeout}}--on_elected_prepare_timeout \"{{marathon.on-elected-prepare-timeout}}\"{{/marathon.on-elected-prepare-timeout}} {{#marathon.plugin-conf}}--plugin_conf \"{{marathon.plugin-conf}}\"{{/marathon.plugin-conf}} {{#marathon.plugin-dir}}--plugin_dir \"{{marathon.plugin-dir}}\"{{/marathon.plugin-dir}} {{#marathon.reconciliation-initial-delay}}--reconciliation_initial_delay \"{{marathon.reconciliation-initial-delay}}\"{{/marathon.reconciliation-initial-delay}} {{#marathon.reconciliation-interval}}--reconciliation_interval \"{{marathon.reconciliation-interval}}\"{{/marathon.reconciliation-interval}} {{#marathon.revive-offers-repetitions}}--revive_offers_repetitions \"{{marathon.revive-offers-repetitions}}\"{{/marathon.revive-offers-repetitions}} {{#marathon.scale-apps-initial-delay}}--scale_apps_initial_delay \"{{marathon.scale-apps-initial-delay}}\"{{/marathon.scale-apps-initial-delay}} {{#marathon.scale-apps-interval}}--scale_apps_interval \"{{marathon.scale-apps-interval}}\"{{/marathon.scale-apps-interval}} {{#marathon.sentry}}--sentry \"{{marathon.sentry}}\"{{/marathon.sentry}} {{#marathon.sentry-tags}}--sentry_tags \"{{marathon.sentry-tags}}\"{{/marathon.sentry-tags}} {{#marathon.ssl-keystore-password}}--ssl_keystore_password \"{{marathon.ssl-keystore-password}}\"{{/marathon.ssl-keystore-password}} {{#marathon.ssl-keystore-path}}--ssl_keystore_path \"{{marathon.ssl-keystore-path}}\"{{/marathon.ssl-keystore-path}} {{#marathon.storage-compaction-interval}}--storage_compaction_interval \"{{marathon.storage-compaction-interval}}\"{{/marathon.storage-compaction-interval}} {{#marathon.storage-compaction-scan-batch-size}}--storage_compaction_scan_batch_size \"{{marathon.storage-compaction-scan-batch-size}}\"{{/marathon.storage-compaction-scan-batch-size}} {{#marathon.store-cache}} --store_cache{{/marathon.store-cache}}{{^marathon.store-cache}}--disable_store_cache{{/marathon.store-cache}} {{#marathon.suppress-offers}} --suppress_offers{{/marathon.suppress-offers}}{{^marathon.suppress-offers}}--disable_suppress_offers{{/marathon.suppress-offers}} {{#marathon.task-launch-confirm-timeout}}--task_launch_confirm_timeout \"{{marathon.task-launch-confirm-timeout}}\"{{/marathon.task-launch-confirm-timeout}} {{#marathon.task-launch-timeout}}--task_launch_timeout \"{{marathon.task-launch-timeout}}\"{{/marathon.task-launch-timeout}} {{#marathon.task-lost-expunge-initial-delay}}--task_lost_expunge_initial_delay \"{{marathon.task-lost-expunge-initial-delay}}\"{{/marathon.task-lost-expunge-initial-delay}} {{#marathon.task-lost-expunge-interval}}--task_lost_expunge_interval \"{{marathon.task-lost-expunge-interval}}\"{{/marathon.task-lost-expunge-interval}} {{#marathon.task-reservation-timeout}}--task_reservation_timeout \"{{marathon.task-reservation-timeout}}\"{{/marathon.task-reservation-timeout}} {{#marathon.webui-url}}--webui_url \"{{marathon.webui-url}}\"{{/marathon.webui-url}} --zk {{#marathon.zk}}{{marathon.zk}}{{/marathon.zk}}{{^marathon.zk}}zk://master.mesos:2181/universe/{{service.name}}{{/marathon.zk}} {{#marathon.zk-compression}} --zk_compression{{/marathon.zk-compression}}{{^marathon.zk-compression}}--disable_zk_compression{{/marathon.zk-compression}} {{#marathon.zk-compression-threshold}}--zk_compression_threshold \"{{marathon.zk-compression-threshold}}\"{{/marathon.zk-compression-threshold}} {{#marathon.zk-connection-timeout}}--zk_connection_timeout \"{{marathon.zk-connection-timeout}}\"{{/marathon.zk-connection-timeout}} {{#marathon.zk-max-node-size}}--zk_max_node_size \"{{marathon.zk-max-node-size}}\"{{/marathon.zk-max-node-size}} {{#marathon.zk-max-versions}}--zk_max_versions \"{{marathon.zk-max-versions}}\"{{/marathon.zk-max-versions}} {{#marathon.zk-session-timeout}}--zk_session_timeout \"{{marathon.zk-session-timeout}}\"{{/marathon.zk-session-timeout}} {{#marathon.zk-timeout}}--zk_timeout \"{{marathon.zk-timeout}}\"{{/marathon.zk-timeout}}",
  "labels": {
    "DCOS_PACKAGE_FRAMEWORK_NAME": "{{#marathon.framework-name}}{{marathon.framework-name}}{{/marathon.framework-name}}{{^marathon.framework-name}}{{service.name}}{{/marathon.framework-name}}",
    "DCOS_SERVICE_NAME": "{{service.name}}",
    "DCOS_SERVICE_SCHEME": "http",
    "DCOS_SERVICE_PORT_INDEX": "0"
  }
}
